package com.etone.smartAudit.vo.workOrder;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author 张任豪
 */
@AllArgsConstructor
@NoArgsConstructor
@Builder
@Data
@ApiModel(value = "返回请求")
public class ResponseVO<T> {

    @ApiModelProperty("返回信息")
    private String message;
    @ApiModelProperty("返回状态码")
    private String code;
    @ApiModelProperty("返回数据")
    private T data;

    public static ResponseVO success(){
        return new ResponseVO("success","200",null);
    }

    public ResponseVO success(T data){
        return new ResponseVO("success","200",data);
    }

    public static ResponseVO success(String message){
        return new ResponseVO(message,"200",null);
    }

    public ResponseVO success(String message, T data){
        return new ResponseVO(message,"200",data);
    }

    public static ResponseVO fail(){
        return new ResponseVO("fail","500",null);
    }

    public static ResponseVO fail(String message){
        return new ResponseVO(message,"500",null);
    }

    public ResponseVO fail(String message, T data){
        return new ResponseVO(message,"500",data);
    }


}
